﻿namespace NTLib.Core.Shared
{
    using System;
    using System.ComponentModel;

    /// <summary>
    /// Define an object that could shared properties between instance and shared object.
    /// </summary>
    public interface ISharedObject : INotifyPropertyChanged, INotifyDataErrorInfo, IDisposable
    {
        #region Methods

        /// <summary>
        /// Clears the value.
        /// </summary>
        void ClearLocalValue(ISharedValueKey prop);

        /// <summary>
        /// Gets the value.
        /// </summary>
        T GetValue<T>(ISharedValueKey prop);

        /// <summary>
        /// Sets the value.
        /// </summary>
        bool SetValue<T>(ISharedValueKey prop, T value);

        /// <summary>
        /// Sets the value shared by all the instance that have the shared Property.
        /// </summary>
        bool OverrideSharedValue<T>(ISharedValueKey prop, T value);

        #endregion
    }
}
